/*
The MIT License
Copyright (c) 2019 Lehrstuhl Informatik 11 - RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE

This file is part of embeddedRTPS.

Author: i11 - Embedded Software, RWTH Aachen University
*/

#ifndef RTPS_CONFIG_H
#define RTPS_CONFIG_H

#include "rtps/common/types.h"

#define IS_LITTLE_ENDIAN 1
extern int OVERALL_HEAP_SIZE;
extern const VendorId_t VENDOR_ID;
extern const uint8_t IP_ADDRESS[4]; // Needs to be set in lwipcfg.h too.
extern const GuidPrefix_t BASE_GUID_PREFIX;
extern const Duration_t SPDP_DEFAULT_REMOTE_LEASE_DURATION;// Default lease duration for remote participants, usually overwritten by remote info
extern const Duration_t SPDP_MAX_REMOTE_LEASE_DURATION;

#define DOMAIN_ID  0 // 230 possible with UDP
#define MAX_NUM_PARTICIPANTS 2
#define NUM_STATELESS_WRITERS (MAX_NUM_PARTICIPANTS + 1) // Required + Additional
#define NUM_STATELESS_READERS (MAX_NUM_PARTICIPANTS + 1) // Required + Additional
#define NUM_STATEFUL_READERS  4 // 1-4 required per participant depending on what they do and to whom they match
#define NUM_STATEFUL_WRITERS  4 // 1-4 required per participant depending on what they do and to whom they match
#define NUM_WRITERS_PER_PARTICIPANT 4
#define NUM_READERS_PER_PARTICIPANT 4
#define NUM_WRITER_PROXIES_PER_READER 3
#define NUM_READER_PROXIES_PER_WRITER 3
#define MAX_NUM_UNMATCHED_REMOTE_WRITERS 100
#define MAX_NUM_UNMATCHED_REMOTE_READERS 10
#define HISTORY_SIZE 10
#define MAX_TYPENAME_LENGTH 20
#define MAX_TOPICNAME_LENGTH 20
#define HEARTBEAT_STACKSIZE 1200          // byte
#define THREAD_POOL_WRITER_STACKSIZE 1100 // byte
#define THREAD_POOL_READER_STACKSIZE 1600 // byte
#define SPDP_WRITER_STACKSIZE 550    // byte
#define SF_WRITER_HB_PERIOD_MS 500
#define SPDP_RESEND_PERIOD_MS 10000
#define SPDP_CYCLECOUNT_HEARTBEAT 2 // skip x SPDP rounds before checking liveliness
#define SPDP_WRITER_PRIO 3
#define SPDP_MAX_NUMBER_FOUND_PARTICIPANTS 5
#define SPDP_MAX_NUM_LOCATORS 5
#define MAX_NUM_UDP_CONNECTIONS 10
#define THREAD_POOL_NUM_WRITERS 2
#define THREAD_POOL_NUM_READERS 2
#define THREAD_POOL_WRITER_PRIO 3
#define THREAD_POOL_READER_PRIO 3
#define THREAD_POOL_WORKLOAD_QUEUE_LENGTH 10

#endif // RTPS_CONFIG_H
